package com.jeeplus.modules.sys.security;

import org.springframework.beans.factory.annotation.Value;

import java.util.LinkedHashMap;

/**
 * @author liangbing
 * @version 1.0
 * @date 2021/3/23 8:08
 * @description xxx
 */
public class FilterChainDefinitionMapBuilder {

    /**
     * 管理基础路径
     */
    @Value("${adminPath}")
    protected String adminPath;

    /**
     * 自定义 FilterChainDefinition
     * @return
     */
    public LinkedHashMap<String, String> buildFilterChainDefinitionMap() {
        LinkedHashMap<String, String> map = new LinkedHashMap<>();

        map.put("/static/**", "anon");
        map.put("/wx/**", "anon");
        map.put("/android/**", "anon");
        map.put("/userfiles/**", "anon");
        map.put(adminPath + "/sys/user/infoCareStatus", "anon");
        map.put(adminPath + "/sys/user/validateLoginName", "anon");
        map.put(adminPath + "/sys/user/validateMobile", "anon");
        map.put(adminPath + "/sys/user/validateMobileExist", "anon");
        map.put(adminPath + "/sys/user/resetPassword", "anon");
        map.put(adminPath + "/sys/register", "anon");
        map.put(adminPath + "/sys/register/registerUser", "anon");
        map.put(adminPath + "/sys/register/getRegisterCode", "anon");
        map.put(adminPath + "/sys/register/validateMobileCode", "anon");
        map.put(adminPath + "/soft/sysVersion/getAndroidVer", "anon");
        map.put(adminPath + "/soft/sysVersion/getIosVer", "anon");
        map.put(adminPath + "/cas", "cas");
        map.put(adminPath + "/login", "authc");
        map.put(adminPath + "/logout", "anon");
        map.put(adminPath + "/web/yjMahjongHall/createMahjongHall", "anon");
        map.put(adminPath + "/web/yjMahjongHall/saveMahjongHall", "anon");
        map.put(adminPath + "/web/yjMahjongHall/mahjongHallsList", "anon");
        map.put(adminPath + "/web/yjMahjongHall/mahjongHallsCount", "anon");
        map.put(adminPath + "/web/yjMahjongHall/mahjongHallInfo", "anon");
        map.put(adminPath + "/web/yjMahjongHall/deleteMahjongHall", "anon");
        map.put(adminPath + "/web/yjMahjongHallRoom/createMahjongHallRoom", "anon");
        map.put(adminPath + "/web/yjMahjongHallRoom/getMahjongHallRoomInfo", "anon");
        map.put(adminPath + "/web/yjMahjongHallRoom/editMahjongHallRoom", "anon");
        map.put(adminPath + "/web/yjMahjongHallRoom/bindQRCode", "anon");
        map.put(adminPath + "/web/yjMahjongHallRoom/deleteMahjongHallRoom", "anon");
        map.put(adminPath + "/web/yjMahjongHallWaiters/createMahjongHallWaiters", "anon");
        map.put(adminPath + "/web/yjMahjongHallWaiters/getMahjongHallWaiterInfo", "anon");
        map.put(adminPath + "/web/yjMahjongHallWaiters/editMahjongHallWaiter", "anon");
        map.put(adminPath + "/web/yjMahjongHallWaiters/deleteMahjongHallWaiters", "anon");
        map.put(adminPath + "/web/yjMahjongHallWaiters/login", "anon");			//android端服务生登录
        map.put(adminPath + "/web/yjMahjongHallWaiters/voicesList", "anon");    //android端服务生负责的呼叫录音列表
        map.put(adminPath + "/web/yjMahjongHallWaiters/responseCall", "anon");  //android端服务生响应呼叫请求
        map.put(adminPath + "/web/yjMahjongHallWaiters/completeCall", "anon");  //android端服务生完成呼叫请求
        map.put(adminPath + "/web/yjMahjongHallWaiters/uploadAvatar", "anon");  //android端上传服务生头像
        map.put(adminPath + "/web/yjMahjongHallWaiters/updateMahjongHallWaiter", "anon");  //android端更新服务生属性
        map.put(adminPath + "/web/yjMahjongHallWaiters/getAndroidMahjongHallWaiterInfo", "anon"); //android端获得服务生详情
        map.put(adminPath + "/web/yjQrcodes/downloadQrcode", "anon");
        map.put(adminPath + "/web/salesman/login", "anon");
        map.put(adminPath + "/web/privacy", "anon");
        map.put(adminPath + "/web/common/*", "anon");
        map.put(adminPath + "/**", "user");
        map.put("/act/rest/service/editor/**", "perms[act:model:edit]");
        map.put("/act/rest/service/model/**", "perms[act:model:edit]");
        map.put("/act/rest/service/**", "user");
        map.put("/ReportServer/**", "user");

        return map;
    }
}
